package cn.jishiyu11.xeqb.activity.personalCenterActivitys

import android.os.Bundle
import android.view.View
import android.widget.TextView
import cn.jishiyu11.xeqb.R
import cn.jishiyu11.xeqb.base.BaseActivity
import cn.jishiyu11.xeqb.utils.SharedPreferencesUtils
import cn.jishiyu11.xeqb.utils.USER_PhoneNo
import cn.jishiyu11.xeqb.utils.USER_UserNo
import com.umeng.analytics.MobclickAgent
import kotlinx.android.synthetic.main.act_personalaccount.*
import kotlinx.android.synthetic.main.tab_activity_fra.*

/**
 * Created by jsy_zj on 2018-03-05.
 * 个人中心------个人信息
 */
class PersonalAccount:BaseActivity() {


    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.act_personalaccount)
        findViewById()
        act_personalaccount_userid.text = USER_UserNo
        act_personalaccount_userphone.text =dispostPhoneNo(USER_PhoneNo)
    }

    override fun findViewById() {
        title_image.visibility = View.VISIBLE
        title_image.setOnClickListener{finish()}
        (title_view as TextView).text = this.getString(R.string.personal_account_data)
    }

    override fun initView() {
    }

    override fun onResume() {
        super.onResume()
        MobclickAgent.onResume(this)
    }

    override fun onPause() {
        super.onPause()
        MobclickAgent.onPause(this)
    }

    /**
     * 对手机号中间四位进行遮盖处理
     * */
    fun dispostPhoneNo(no: String?): String {
        return no?.substring(0, 3) + "****" + no?.substring(no?.length - 4, no?.length)
    }

}